#include <stdio.h>
#include <stdlib.h>
 
int main()
{
	printf("%d\n", atoi("123"));
	return 0;
}

#if 0

gcc main.c
./a.out

ldd a.out
        linux-vdso.so.1 (0x00007ffd72cf1000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f334b44d000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f334b662000)

strings /lib64/ld-linux-x86-64.so.2 | grep atoi
strings /lib/x86_64-linux-gnu/libc.so.6 | grep atoi             # here

gcc -shared -fPIC _atoi.c -o _atoi.so

LD_PRELOAD=$PWD/_atoi.so ./a.out

LD_PRELOAD=$PWD/_atoi.so ldd ./a.out
        linux-vdso.so.1 (0x00007ffc423f7000)
        /home/share/work/ac-code/reverse/attack/infect/ld_preload/_atoi.so (0x00007feb09c27000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007feb09a19000)
        /lib64/ld-linux-x86-64.so.2 (0x00007feb09c33000)


 LD_PRELOAD="库文件路径"，设置要优先替换动态链接库

 用 LD_PRELOAD 后，程序会先去找 LD_PRELOAD 路径动态库里面的方法

#endif
